import service from "@/utils/request";
import { sheepfileQuery } from "./model";
import { Addsheepfile } from "./model";
import { ListsheepfileQuery } from "./model";
const DEPT_BASE_URL = "/api/";

class sheepfile{
  //羊只档案列表显示
static getList(queryParams?: sheepfileQuery) {
    return service<any, sheepfileQuery>({
      url: `${DEPT_BASE_URL}SheepFileModels/GetSheepfilemodel`,
      method: "post",
      data: queryParams,
    });
}
  
  //羊只档案添加
static async addsheepfile(data:any) {
    return service({
      url: `/api/SheepFileModels/AddSheepfilemodel`,
      method: "post",
      data,
    });
  }

  //羊只档案反填
static async listsheepfile(sheepfileId:any) {
    return service({
      url: `${DEPT_BASE_URL}SheepFileModels/ListSheepfilemodel`,
      method: "get",
      params: {
        sheepFileId: sheepfileId,
      }
    });
  }

 //羊只档案删除
static async deletesheepfile(data:any) {
    return service({
      url: `${DEPT_BASE_URL}SheepFileModels/DeleteSheepfilemodel`,
      method: "post",
      data
    });
  }

   //羊只档案修改
static async updatesheepfile(data:any) {
    return service({
      url: `/api/SheepFileModels/UpdaSheepfilemodel`,
      method: "post",
      data,
    });
  }
//养只档案状态
static async updatesheepfilestatus(presentState:any,sheepType:any) {
    return service({
      url: `/api/SheepFileModels/IsSexSheepfilemodel`,
      method: "get",
      params: {
        presentState: presentState,
        sheepType:sheepType
      }
    });
  }
/**
   *获取3代关系表
   *
   * @returns 获取3代关系表
   */
  static async GetGenealogy(sheepfileId: number) {
     return service({
      url: `/api/SheepFileModels/GetGenealogy`,
      method: "get",
      params: {
        sheepfileId: sheepfileId
      }
    });
  }  //根据耳号反填羊只档案
  static detilsheepfile(eartag: any)
  {
    return service({
      url: `/api/SheepFileModels/DteilSheepfilemodel`,
      method: "get",
      params: {
        eartag:eartag
      }
    });
  }
//根据生长阶段和在场状态获取耳号
  static grothshrrpfile(presentState:any,sheepType:any,growthstage:any)
  {
    return service({
      url: `/api/SheepFileModels/GrothSheepfilemodel`,
      method: "get",
      params: {
        presentState: presentState,
        sheepType: sheepType,
        growthstage: growthstage
      }
    });
  }
}
  
  
  //根据繁殖状态，在场状态获取耳号
static async getReproductionState(presentState:any,sheepType:any) {
    return service({
      url: `/api/SheepFileModels/GetReproductionState`,
      method: "get",
      params: {
        presentState: presentState,
        sheepType: sheepType,
      }
    });
}








export default sheepfile;



